<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //条件判断
    let xhs = 5, xg =1;
    if(xg>0){
        xhs = 1;
    }
    console.log(xhs);
    /*
    if(条件表达式){
        条件不为真
    }
    */
   //取两个值中的最大值
   let num1=9,num2=21,max;
   if(num1>num2){
    num1=num2
   }else{
        max=num2
   }
   console.log('最大值'+max)
</script>
</html>